Skip to content

difftest: cleanup wgpu runner#587

Draft
Firestar99 wants to merge 7 commits intomainfrom
difftest_runner_cleanup
Draft

difftest: cleanup wgpu runner#587
Firestar99 wants to merge 7 commits intomainfrom
difftest_runner_cleanup

Conversation

@Firestar99
Copy link
Copy Markdown
Member

@Firestar99 Firestar99 commented Apr 24, 2026

Extracted from #334

@Firestar99 Firestar99 force-pushed the difftest_runner_cleanup branch 2 times, most recently from 603efd7 to 408a0bb Compare April 24, 2026 11:29
@Firestar99 Firestar99 force-pushed the difftest_runner_cleanup branch from 408a0bb to c0cb9e0 Compare April 24, 2026 11:31
Base automatically changed from difftest_refactor to main April 24, 2026 14:02
@Firestar99 Firestar99 force-pushed the difftest_runner_cleanup branch from c0cb9e0 to 08ad9fd Compare April 27, 2026 09:38
@Firestar99 Firestar99 force-pushed the difftest_runner_cleanup branch from 08ad9fd to 81640a0 Compare April 27, 2026 10:57
@Firestar99 Firestar99 force-pushed the difftest_runner_cleanup branch from 81640a0 to f1250b9 Compare April 27, 2026 12:21
Copy link
Copy Markdown
Member

@eddyb eddyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo a few small things, anything else blocking this?

Comment thread tests/difftests/tests/lib/src/scaffold/compute/wgpu_runner.rs Outdated
Comment thread tests/difftests/tests/lib/src/scaffold/compute/wgpu_runner.rs Outdated
Comment thread tests/difftests/tests/lib/src/scaffold/compute/wgpu_runner.rs Outdated
Comment on lines +244 to +251
let (sender, receiver) = futures::channel::oneshot::channel();
buffer_slice.map_async(wgpu::MapMode::Read, move |res| {
let _ = sender.send(res);
});
device.poll(wgpu::PollType::wait_indefinitely())?;
block_on(receiver)
.context("mapping canceled")?
.context("mapping failed")?;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the wgpu example runner do it this way? Or does it just unwrap the Result in the closure passed to map_async?

Copy link
Copy Markdown
Member Author

@Firestar99 Firestar99 May 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually does, that said, I'm not a huge fan of the download code AI wrote so let me refactor it a little. encoder.map_buffer_on_submit() is way cleaner as a map_async() replacement.

Also noticed it was only ever writing out the first writable buffer, if you had two the second one would just be ignored... I'll just append all the buffers. But I also don't want to spend too much time on this and rather completely refactor the difftest framework yet again, will propose my idea on zulip today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants